package com.qianyu.project.web.controller.smj;

import com.qianyu.project.entity.LaborContract;
import com.qianyu.project.entity.ProjectSalary;
import com.qianyu.project.service.smj.smjLaberSalaryService;
import com.qianyu.project.utils.Result;
import com.qianyu.project.utils.ResultTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/smj_laber_salary")
public class smjLaberSalaryController {
    @Autowired
    private smjLaberSalaryService lss;

    @GetMapping("")
    public String AddLaberSalary(String p_id,String type,String year,String menth,String apply_date,String handler_id,String attach_ids){
        return lss.AddLaberSalary( p_id, type, year, menth, apply_date, handler_id, attach_ids);
    }

    @GetMapping("/AddWorkList")
    public void AddWorkList(String salary_id,String name,String type,String day,String salaryday,String salary,String salaryplus,String borrowsalary,String insurancesalary,String deductsalary){
         lss.AddWorkList(salary_id, name, type, day, salaryday, salary, salaryplus, borrowsalary, insurancesalary, deductsalary);
    }

    @PostMapping("/FlowSalary")
    public Integer FlowSalary(@RequestBody ProjectSalary projectSalary){
        return lss.FlowSalary(projectSalary);
    }

    @GetMapping("/listlabersalary")
    public Result listlabersalary(@RequestParam Map<String,String> params){
        Map<String, Object> map =new HashMap<>();
        //查询合同
        map.put("data", lss.listlabersalary(params));
        return ResultTool.success(map);
    }

    @GetMapping("/getWorkList")
    public List<Map<String ,Object>> getWorkList(String id){
        return lss.getWorkList(id);
    }

    @GetMapping("/getfromaudit")
    public List<Map<String ,Object>> getfromaudit(String id){
        return lss.getfromaudit(id);
    }

}
